<?php
/* @var $model Ad */
/* @var $this AdController */
?>
<?php
$this->breadcrumbs = array(
    'Event' => array('index'),
    'Manage Event',
);
?>
<div class="box">
    <header>
        <h5>Manage Event <a class="btn btn-small btn-warning" href="<?php BACKEND_SITE_URL ?>event/create"> <i class="icon-plus"></i> Create event</a></h5>	
    </header>
    <div class="body">
	<?php
	$this->widget('bootstrap.widgets.TbGridView', array(
	    'id' => 'eblast-grid',
	    'dataProvider' => $model->search(),
	    'filter' => $model,
	    'columns' => array(
		'title',
		array(
		    'header' => 'Username',
		    'type' => 'raw',
		    'name' => 'userName',
		    'value' => function($data) {
			return "<a href='" . BACKEND_SITE_URL . "user/member/update?id=" . $data->user->user_id . "'>" . h($data->user->username, 10) . "</a>";
		    }
		),
		array(
		    'header' => 'Event Date',
		    'name' => 'start',
		    'type' => 'date',
		    'filter' => false
		),
		array(
		    'header' => 'Date Created',
		    'name' => 'created',
		    'type' => 'date',
		    'filter' => false
		),
		array(
		    'class' => 'bootstrap.widgets.TbButtonColumn',
		    'template' => '{update}{delete}',
		),
	    ),
	));
	?>
    </div>
</div>